package game.entity;

import engine.graphics.IUpdate;
import engine.system.IInit;

public abstract class Entity extends OwningEntityAttributes implements IUpdate, IInit{

	private static final long serialVersionUID = 1L;

	public static final int INVENTORY_SIZE = 28 ; 
	
	private boolean dead = false ; 
	
	public Entity(EntityAttributes attr){
		super(attr); 
		this.init(); 
	}
	
	public void init(){
	}

	public void die(){
		dead = true ; 
	}
	
	public boolean isDead(){
		return dead ; 
	}
	
	public void update(){
		this.getAttributes().update(); 
		if(this.getAttributes().getHealth() <= 0)
			die(); 
	}
		
}
